package hDOJ;

import java.text.DecimalFormat;
import java.util.Scanner;
import java.io.*;
public class Main2048_two {
    
    public static void main(String[] args) {
        
        Scanner scan = new Scanner(new BufferedInputStream(System.in));
        //创建小数格式化对象
        DecimalFormat myformat = new DecimalFormat("#0.00");
        int n = scan.nextInt();
        double a[] = new double[21];
        a[1] = 1;
        for (int i = 2; i <= 20; i++) {
            a[i] = i * a[i - 1];
        }
        double b[] = new double[21];
        b[1] = 0;  b[2] = 1;
        for (int i = 3; i <= 20; i++) {
            b[i] = i * b[i - 1];//全错位排列公式 f(n)=nf(n-1)+(-1)^(n-2)或者f(n)=(n-1) {f(n-1)+f(n-2)}
            if (i % 2 == 0)
                b[i] += 1;
            else
                b[i] -= 1;
        }
        while (n-- != 0) {
            int i = scan.nextInt();
            System.out.println(myformat.format(100.0 * b[i] / a[i]) + "%");
        }
    }
}